From 5ac47f7c4f69867024a1799fa09e70c0e7ba3779 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 2 Aug 2006 15:07:21 +0100 Subject: [PATCH] [PCI] Transparent virtualization for pcifront and pciback. Signed-off-by: Tristan Gingold --- linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c | 3 +++ linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c index 6927e038f1..86223a35ec 100644 --- a/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c @@ -445,6 +445,9 @@ static struct xenbus_driver xenbus_pciback_driver = { int __init pciback_xenbus_register(void) { + if (!is_running_on_xen()) + return -ENODEV; + return xenbus_register_backend(&xenbus_pciback_driver); } diff --git a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c index f3a642e5b6..4fd9262f9d 100644 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c @@ -284,11 +284,10 @@ static struct xenbus_driver xenbus_pcifront_driver = { static int __init pcifront_init(void) { - int err = 0; - - err = xenbus_register_frontend(&xenbus_pcifront_driver); + if (!is_running_on_xen()) + return -ENODEV; - return err; + return xenbus_register_frontend(&xenbus_pcifront_driver); } /* Initialize after the Xen PCI Frontend Stub is initialized */ -- 2.30.2